home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_lavaintrobub.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  113 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_LavaBubbles.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     entered
  14.     message     pulse
  15.     
  16.     thing       blurp           local
  17.     thing       bloop0
  18.     thing       bloop1
  19.     thing       bloop2
  20.     thing       bloop3
  21.     thing       bloop4
  22.     thing       bloop5
  23.     thing       bloop6
  24.     
  25.     sector      sec_Start1
  26.     sector      sec_Stop1
  27.     
  28.     template    tpl_Bubble=lavabubopp       local
  29.     template    tpl_Sparks=lavasparks       local
  30.  
  31.     material    bubbleSkin=bubble_a4lava_top.mat        local
  32.     material    lavaSkin=gen_a4sfx_lava_particle.mat    local
  33.     
  34.     sound       sfx_Bloop0=gen_lava_bloop_a.wav      local
  35.     sound       sfx_Bloop1=gen_lava_blurp_a.wav      local
  36.     
  37.     int         animId      local
  38.     int         randNum     local
  39.     int         bubsOn=1    local
  40.     
  41.     
  42. end
  43.  
  44. # ========================================================================================
  45.  
  46. code
  47.  
  48. startup:
  49.  
  50.     SetPulse(1.0);
  51.     return;
  52.     
  53. # ========================================================================================
  54.  
  55. entered:
  56.  
  57.     if((GetSenderRef() == sec_Start1) && (bubsOn == 0))
  58.     {
  59.         bubsOn = 1;
  60.         SetPulse(1.0);
  61.     }
  62.     
  63.     if(GetSenderRef() == sec_Stop1)
  64.     {
  65.         bubsOn = 0;
  66.         Sleep(1.5);
  67.         SetPulse(0.0);
  68.     }
  69.     
  70.     return;
  71.  
  72. # ========================================================================================
  73.  
  74. pulse:
  75.  
  76.     randNum = RandBetween(0, 6);
  77.     
  78.     # create bubble at random position
  79.     blurp = CreateThing(tpl_Bubble, bloop0[randNum]);
  80.     CaptureThing(blurp);
  81.     
  82.     # move bubble to frame
  83.     MoveToFrame(blurp, 1, 1.5);
  84.     
  85.     # animate the bubble mat
  86.     SetMaterialCel(bubbleskin, 0);
  87.     
  88.     # set the "looping" flag (0x1) on the animation -- without it, the animation ends by itself, and the stopAnim() below
  89.     # stops random animations that may be playing elsewhere (like the tiki columns :)
  90.  
  91.     animId = MaterialAnim(bubbleskin, 48, 0x0);    
  92.     
  93.     # play the bloop/blurp sfx
  94.     PlaySoundThing(sfx_Bloop0[RandBetween(0, 1)], blurp, 1.0, 10.0, 15.0, 0x0);
  95.     
  96.     # create lava sparks
  97.     SetMaterialCel(lavaskin, 0);
  98.     CreateThing(tpl_Sparks, bloop0[randNum]);
  99.     MaterialAnim(lavaskin, 4, 0);
  100.     
  101.     # get ready for the next one
  102.     WaitForStop(blurp);
  103.     Sleep(0.45);
  104.     #StopAnim(animId);
  105.     DestroyThing(blurp);
  106.     
  107.     return;
  108.  
  109. # ========================================================================================
  110.  
  111. end
  112.  
  113.